package ch.zbw.rre.sortieren;

public class StraightInsertation implements Isorter {

	private int[] feld;
	
	public StraightInsertation() {
		this.feld = null;
	}

	@Override
	public void sort(int[] zahlen) {
		this.feld = zahlen;
		int temp;
		int y;
		for (int i = 1; i <= (this.feld.length -1); i++){
			temp = this.feld[i];
			
			for (y = i; (y>=1) && (temp <this.feld[y-1]); y--){
				this.feld[y] = this.feld[y-1];
			}
			this.feld[y] = temp;
		}
		
	}

}
